<!DOCTYPE html>
<html>
<head>
<title>图片表</title>
<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">

			<div class="col-sm-2 control-label">
				<select class="form-control" v-model="q.imgType" @change="query" placeholder="审核状态">
					<option value ="88">全部</option>
					<option value ="1">log图</option>
					<option value ="2">首页图</option>
					<option value ="3">核心产品图</option>
					<option value ="4">经济效益分析图</option>
					<option value ="5">企业介绍图</option>
					<option value ="6">联系我们图</option>

				</select>
			</div>
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.firstImgId" @keyup.enter="query" placeholder="上级图片id">
			</div>
			<a class="btn btn-default" @click="query">查询</a>

			<#if shiro.hasPermission("img:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("img:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("img:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
											<div class="form-group">
			   	<div class="col-sm-2 control-label">图片编号</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="img.imgCode" placeholder="从1开始根据编号做图片排版例如1就是第一张图"/>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">上级图片id</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="img.firstImgId" placeholder="上级图片id 0表示没有上级"/>
			    </div>
			</div>

			<div class="form-group">
			   	<div class="col-sm-2 control-label">图片类型</div>
			   	<div class="col-sm-10">
					<select class="form-control" v-model="img.imgType" placeholder="图片类型 1 log图  2 首页图 3 核心产品图 4 经济效益分析图 5 企业介绍图 6 联系我们图等等">
						<option value ="88">全部</option>
						<option value ="1">log图</option>
						<option value ="2">首页图</option>
						<option value ="3">核心产品图</option>
						<option value ="4">经济效益分析图</option>
						<option value ="5">企业介绍图</option>
						<option value ="6">联系我们图</option>
					</select>
			    </div>
			</div>
									<div class="form-group">
			   	<div class="col-sm-2 control-label">图片描述</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="img.imgDescribe" placeholder="图片描述"/>
			    </div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label">图片</div>
				<div class="col-sm-10">
					<input type="file" accept="image/gif,image/jpeg,image/jpg,image/png" ref="file" id="file" name="file" @change="changeImage($event)" class="form-control" placeholder="图片"/>
					<img  :src="imgCache" style="max-width: 400px">
					<!--<input type="text" class="form-control" v-model="headImg.imgUrl" placeholder="图片地址"/>-->
				</div>
			</div>

									<div class="form-group">
			   	<div class="col-sm-2 control-label">--保留字段</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="img.others" placeholder="--保留字段"/>
			    </div>
			</div>
							<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
</div>

<script src="${request.contextPath}/statics/js/modules/sys/img.js?_${.now?long}"></script>
</body>
</html>